import { request } from '@/utils/request.js'

/**
 * 任务 API JS
 */

export default {
  /**
   * 获取列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'sea/waybillTaskSend/index',
      method: 'get',
      params
    })
  },

   /**
   * 读取数据
   * @returns
   */
   read (id) {
    return request({
      url: 'sea/waybillTaskSend/read/' + id,
      method: 'get',
    })
  },
  /**
   * 添加
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/save',
      method: 'post',
      data
    })
  },
/**
   * 配货
   * @returns
   */
distribute (data = {}) {
  return request({
    url: 'sea/waybillTaskSend/distribute',
    method: 'post',
    data
  })
},
/**
   * 移除配货
   * @returns
   */
distributeOut (data = {}) {
  return request({
    url: 'sea/waybillTaskSend/distributeOut',
    method: 'post',
    data
  })
},
  /**
   * 更新运单数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/update/' + data.id,
      method: 'put',
      data
    })
  },
  //审核通过
  review(data = {}) {
      return request({
          url: '/sea/waybillTaskSend/review',
          method: 'post',
          data
      })
  },
  //驳回
  turndown(data = {}) {
    return request({
        url: '/sea/waybillTaskSend/turndown',
        method: 'post',
        data
    })
  },
  //出库
  outwarehouse(data = {}) {
    return request({
        url: '/sea/waybillTaskSend/outwarehouse',
        method: 'post',
        data
    })
  },
  //完成
  close(data = {}) {
    return request({
        url: '/sea/waybillTaskSend/close',
        method: 'post',
        data
    })
  },
  //待结算
  pendingSettlement(data = {}) {
      return request({
          url: '/sea/waybillTaskSend/pendingSettlement',
          method: 'post',
          data
      })
  },
  //结算
  settlement(data = {}) {
      return request({
          url: '/sea/waybillTaskSend/settlement',
          method: 'post',
          data
      })
  },
  //作废
  void(data = {}) {
      return request({
          url: '/sea/waybillTaskSend/void',
          method: 'post',
          data
      })
  },
  
    /**
   * 任务消息列表
   * @returns
   */
    getListMsg (params = {}) {
      return request({
        url: 'sea/waybillTaskSend/list',
        method: 'get',
        params
      })
    },
  /**
     * 任务消息删除
     * @returns
     */
  deletesMsg(data) {
    return request({
        url: 'sea/waybillTaskSend/delete',
        method: 'delete',
        data
    })
  },
  /**
   * 任务消息保存
   * @returns
   */
  saveMsg (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/save',
      method: 'post',
      data
    })
  },
   /**
   * 完成出库单
   * @returns
   */
   closeTap (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/close',
      method: 'post',
      data
    })
  },
     /**
   * 车辆上传ISA
   * @returns
   */
     isaCar (data = {}) {
      return request({
        url: 'sea/waybillTaskSend/isa',
        method: 'post',
        data
      })
    },
      /**
     * 车辆上传POD
     * @returns
     */
      podCar (data = {}) {
        return request({
          url: 'sea/waybillTaskSend/pod',
          method: 'post',
          data
        })
      },
       /**
   * 下载BOL
   * @returns
   */
  bolCar (data = {}) {
    return request({
      url: 'sea/waybillTaskSend/bol',
      method: 'post',
      responseType: 'blob',
      data
    })
  },
}